<div id="content">
     <div><span class="title_khoahoc"><img src="<?php echo JS_PATH;?>/tpt/images/lich_hoithao.jpg" width="645" height="161" /></span></div>
     <div class="title_hoithao"><br />
     </div>
<?php
$arrayColor=array(  '#e7627c'=>'#ef97a9',
         				'#eeb37a'=>'#f4cda7',
         				'#b36fb3'=>'#cda0cd',
         				'#aaac70'=>'#c7c8a1'
         				  );
foreach($this->khArr as $row){
	$random = array_rand($arrayColor);
    	?>
     <div style="border: 1px dotted #999999; padding:10px 10px 10px 10px;">
       <table width="100%" border="0" cellpadding="0" cellspacing="0">
         <tr>
           <td colspan="3"><span class="title_hoithao01"><?php echo $row['khoahoc_name']; ?></span><br />
               <table width="99%" border="0" cellspacing="0" cellpadding="0">
                 <tr>
                   <td><span class="style4"><?php echo $row['khoahoc_summary']; ?> </span>(<span class="chi_tiet"><a href="<?php $requestHttp = new  Zend_Controller_Request_Http(); $params=$requestHttp->getParams ();
                   echo $requestHttp->getBaseUrl ().'?pid='.$params['pid'].'&id='.$row['khoahoc_id'];?>">xem thêm</a></span> <span class="chi_tiet">»</span>)</td>
                 </tr>
             </table></td>
         </tr>
         <?php 
         if (count($row['lichhoc'])>0) {?>
         <tr>
           <td width="37%" height="29" bgcolor="<?php echo $random; ?>" class="noi_dung_hoithao">Ngày khai giảng</td>
           <td height="29" colspan="2" align="right" bgcolor="<?php echo $random; ?>" class="noi_dung_hoithao">Địa điểm ( download sơ đồ đừơng đi, khóa học)</td>
         </tr>
         	<?php foreach($row['lichhoc'] as $rowLH) {?>
		         <tr>
		           <td height="29" bgcolor="<?php echo $arrayColor[$random]; ?>" class="noi_dung_hoithao"><?php 
		            $date=new Zend_Date($rowLH['lichhoc_date']);
		            echo $date->getDate('vi_VN')->toString('l','php').', lúc '.
		            	 $date->getDate('vi_VN')->toString('G:i','php').', ngày '.
		            	 $date->getDate('vi_VN')->toString('d/m/Y','php');
		           ?></td>
		           <td width="48%" height="29" align="right" bgcolor="<?php echo $arrayColor[$random]; ?>" class="noi_dung_hoithao"><?php echo $rowLH['lichhoc_place'];?></td>
		           <td width="15%" align="right" bgcolor="<?php echo $arrayColor[$random]; ?>" class="noi_dung_hoithao"><a class="thickbox" onclick="$('#lichhoc').attr('value', '<?php echo $rowLH['lichhoc_id'];?>');" href="#TB_inline?height=50&width=370&inlineId=form_dk"><img src="<?php echo JS_PATH;?>/tpt/images/download.gif" width="90" height="31" vspace="5" border="0" /></a></td>
		         </tr>
		         
		         <?php }?>
         <?php }?>
       </table>
     </div>
 <?php }?>  
 </div>   
 <div id="form_dk" style="display: none">
 	<div id="dk_content">
		         <form action="<?php echo $requestHttp->getBaseUrl ().'/index/index/dangki';?>" name="myform" id="myform" method="post">
					<table>
					      <tr>
					        <td width="42%" class="style1">Ho va Tên <span>&nbsp;*</span></td>
					        <td width="58%"><label>
					          <input name="name" type="text" id="name" size="25" />
					        </label></td>
					      </tr>
					      <tr>
					        <td class="style1">Email <span>&nbsp;*</span></td>
					        <td class="style1"><input name="email" id="email" type="text" size="25" /></td>
					      </tr>
					      <tr>
					        <td class="style1">Phone <span>&nbsp;*</span></td>
					        <td class="style1"><input name="phone" id="phone" type="text" size="25" /></td>
					      </tr>
					      <tr>
					        <td class="style1">&nbsp;</td>
					        <td class="style1"><input type="submit" value="Dang ki"/></td>
					      </tr>
					</table>
					<input name="lichhoc" id="lichhoc" type="hidden" value=""/>
					</form>
	</div>				
</div>
 <script language="JavaScript" type="text/javascript">
    $(document).ready(function()
    {
        var options = {
            target:        '#dk_content',   // target element(s) to be updated with server response
            beforeSubmit:  showRequest,
            url: '<?php echo $requestHttp->getBaseUrl ().'/index/index/dangki';?>',
            type: 'post'  // pre-submit callback
        };

        $("#myform").validate({
            rules:
                {
                name:
                    {
                    required: true
                },
                email:
                    {
                    required: true,
                    email: true
                },
                phone:
                	{
                	required: true
            	}
                },
            messages:
                {
                name:
                    {
                	required: "<br>Vui long nhap ten"
                },
               email:
                    {
                    required: "<br>Vui long nhap email",
                    email: "<br>Vui long nhap dung dia chi email"
                },
                phone:
                	{
            	required: "<br>Vui long nhap so dien thoai"
            	}
              },
            submitHandler: function () {
            	 $("#myform").ajaxSubmit(options);
                return false;
            }
        });
    });
    // pre-submit callback
    function showRequest(formData, jqForm, options) {

        var queryString = $.param(formData);
        return true;
    }
</script>